﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CPPEI.PM.Shell
{
    class ModelUtil
    {
        public static WorkItemCategory Convert(PMServiceRef.WorkItemCategory serData)
        {
            WorkItemCategory wic = new WorkItemCategory();
            wic.Id = serData.Id;
            wic.Code = serData.Code;
            wic.Caption = serData.Caption;
            wic.Level = serData.Level;
            return wic;
        }
        
        public static WorkItemCategory Convert(PMServiceRef.WorkItemCategoryRef serData)
        {
            WorkItemCategory wic = new WorkItemCategory();
            wic.Id = serData.Id;
            wic.Code = serData.Code;
            wic.Caption = serData.Caption;
            wic.Level = serData.Level;
            return wic;
        }

        public static WorkItem Convert(PMServiceRef.WorkItemRef serData)
        {
            WorkItem wi = new WorkItem();
            wi.Id = serData.Id;
            wi.Code = serData.Code;
            wi.Caption = serData.Caption;
            
            return wi;
        }

        public static WorkStage Convert(PMServiceRef.WorkStageRef serData)
        {
            WorkStage ws = new WorkStage();
            ws.Id = serData.Id;
            ws.Code = serData.Code;
            ws.Caption = serData.Caption;

            return ws;
        }

        public static WorkStageItem Convert(PMServiceRef.WorkStageItemRef serData)
        {
            WorkStageItem wsi = new WorkStageItem();
            wsi.Id = serData.Id;
            wsi.Code = serData.Code;
            wsi.Caption = serData.Caption;

            return wsi;
        }
    }
}
